package com.abaaba.project2.controller.wxcontroller;

import com.abaaba.project2.bean.bo.WxGetIdBo;
import com.abaaba.project2.bean.bo.WxGetValueIdBo;
import com.abaaba.project2.bean.vo.BaseRespVo;
import com.abaaba.project2.bean.vo.WxFootprintVo;
import com.abaaba.project2.service.WxFootprintService;
import com.abaaba.project2.util.UserIdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx/footprint")
public class WxFootprintController {
    @Autowired
    WxFootprintService wxFootprintService;

    @RequestMapping("/list")
    public BaseRespVo getFootprintList(Integer page, Integer size) {
        WxFootprintVo wxFootprintVo = wxFootprintService.getFootprintList(UserIdUtil.getUserId(), page, size);
        return BaseRespVo.ok(wxFootprintVo);
    }

    @RequestMapping("/delete")
    public BaseRespVo deleteFootprintList(@RequestBody WxGetIdBo wxGetIdBo) {
       Integer affectedRows =  wxFootprintService.deleteFootprintList(wxGetIdBo.getId());
       return BaseRespVo.ok();
    }
}
